package com.nCoV.EpidemicSurveillance.controller;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.nCoV.EpidemicSurveillance.service.GraphService;


/**
 * @author 张浩田
 * @date 2020年3月10日
 */

@Controller
public class GraphController {
	
	@Autowired
	GraphService graphService;
	
	@RequestMapping("/getnodesedges")
	@ResponseBody
	public Map<String, Object> getAllNodes(){
		Map<String, Object> map = new HashMap<String, Object>();
		List<Map<String, Object>> nodes = graphService.getNodes();
		List<Map<String, Object>> edges = graphService.getEdges();
		map.put("nodes", nodes);
		map.put("edges", edges);
		return map;
	}
	
	
}
